[ci18-7417] Run the tests that already existed - #13
Closed
pavel-te wants to merge 2 commits into
Closed
Conversation
#12) Three surfaces claimed things that were not true, and the one command we recommend first was gated behind a note telling the reader it would not work. **The QA note was false.** README and the CLI both said detect_config lives on the QA environment and that --api-url must be pointed there. Checked against production: POST https://app.ptc.wpml.org/api/v1/detect_config returns 200 with a real body, anonymously, no token. `ptc init` completes against the default URL. Removed from the README, from `show_init_help` and from the 404 hint, which now says what a 404 there actually means. While there: the quick start passed PTC_API_TOKEN to `init`, which does not need one — detect_config is anonymous, and the CLI itself logs that. **A README example failed on copy-paste.** `--file-tag-name=feature-branch` exits 1 with "Unknown option". The `=` form is implemented for --api-url, --api-token, --monitor-interval, --monitor-max-attempts and --action only, and README:85 uses a working --api-url=..., so the rule cannot be inferred. Fixed the example and wrote the rule down under Main Options. Widening the parser is the other way to resolve this; it changes CLI behaviour and needs a release, so it is not in a documentation fix. **Both CI blocks were stale.** The GitHub one pinned v1.0.0, used actions/checkout@v4 and peter-evans/create-pull-request@v5, and opened a fresh PR per run; the GitLab one never downloaded the CLI and triggered on merge_requests, which is not loop-safe. Both are now what `ptc init` prints, verified by running it. The version-pinning example moved v1.0.0 -> v1.0.3. **Dependencies.** The generated GitLab job installed `jq`, which appears nowhere in this script, and omitted `unzip`, which unpacks every download. Checked alpine:3.22: unzip is present as a busybox applet and extraction works, so the recipe was not broken — but it is named now so it survives an image swap. git stays: the push step needs it, the CLI does not. **Three of five examples did not parse.** java-app, react-app and wordpress-wpsite were KEY=VALUE files using {lang}; each died with "Missing 'files:' section", and only {{lang}} is ever substituted. Rewritten as YAML the parser accepts, renamed .config -> .yml since the extension is what suggested the wrong format. config.local.yml.example taught api_token:, deprecated and ignored since v1.0.x — it now shows the env var instead. **Why nothing caught this:** no test ever fed an example to the parser. Added tests/test-config-examples.sh, which builds a scratch project from each config and runs a real --dry-run. Confirmed it fails on the old files before trusting it: dropping the previous java-app.config back in turns it red on both the format and the placeholder. Suite: 230 assertions across 7 files, 0 failures. `bash -n` clean. Every fenced block in the README parses as what it is labelled (four Troubleshooting blocks showed CLI output while tagged bash; they are `text` now), and every link resolves. The wiki half of this ticket is pushed separately as 3d3282d. Co-authored-by: Pavel Tkachenko <tpepost@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was no CI here at all — no workflow file, nothing ran the suites on a push. They took four seconds and were fully offline; they simply never ran unless someone remembered. Meanwhile this repository ships the script customers download by tag, the recipes the product prints, and the copy ptc-action vendors and republishes as @v1, so a broken main becomes a release and a release becomes what every customer's pipeline fetches. The suites run twice. Once on ubuntu-latest with current bash, and once on macos-latest against /bin/bash, which is still 3.2.57 — the CLI targets 3.2 on purpose (busybox mktemp, ci18-7277) and current bash quietly accepts syntax 3.2 rejects, so a contributor on Linux cannot see that break. Each suite runs in its own log group and a failure in one does not hide the others. Three repository checks beyond the suites, each one a defect class ci18-7398 found by hand: - --version must agree with the VERSION constant. - No config/examples/*.config may come back; those were KEY=VALUE files that the parser rejected, and the extension is what suggested the wrong format. - Every fenced block in README.md and docs/*.md must be what it claims: yaml parses, bash survives bash -n. Output samples and code fragments belong in text. Verified against the pre-fix README: it catches both blocks that were tagged bash while showing CLI output. - Only {{lang}} may appear; a single-brace {lang} is taken literally and yields a path nobody has. Link checking is a separate advisory job. A dead link is a real defect, but an upstream hiccup must not turn main red. Fixing what the new checks found in docs/DEVELOPMENT.md: `git clone <repository-url>` is not valid shell (< redirects) and the directory it cd'd into was never the repository name; two debugging examples used {lang}; the --timeout illustration is a case fragment, not a script, so it is text now. Also documented the CI and the offline property of the suites there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded — reopening from a branch with a cleaner history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes ci18-7417. There was no CI in this repository at all — no workflow file, nothing ran the suites on a push or a PR.
That matters more here than in a normal repo: this ships the script customers download by tag, the recipes the product prints on the in-product on-ramp, and the copy
ptc-actionvendors and republishes as@v1. A brokenmainbecomes a release, and a release becomes what every customer's pipeline fetches.The suites already existed — 230 assertions, 4 seconds, fully offline (four stub
curl, the rest only use--dry-run, which skips preflight). They just never ran on their own.suites— the same tests, twicemacos-latest/bin/bash, still 3.2.57ubuntu-latestThe macOS leg is not decoration. The CLI targets bash 3.2 deliberately (busybox
mktemp, ci18-7277), and current bash quietly accepts syntax 3.2 rejects — a contributor on Linux cannot see that break. Each suite gets its own log group, and one failure does not mask the rest.checks— the ci18-7398 defect classes, mechanisedEach of these is something that ticket found by hand:
--versionagrees with theVERSIONconstant.config/examples/*.configcomes back — those wereKEY=VALUEfiles the parser rejected, and the extension is what suggested the wrong format.README.mdanddocs/*.mdis what it claims to be:yamlparses,bashsurvivesbash -n. Output samples and fragments belong intext.{{lang}}appears — a single-brace one is taken literally and yields a path nobody has.Verified the guards can fail, not just pass:
920f458): it catches both blocks that were taggedbashwhile showing CLI output.react-app.yml: caught.tests/: the step went red and reported which one.links— advisorySeparate job,
continue-on-error: true. A dead link is a real defect, but an upstream hiccup must not turnmainred. The API base URL answers 404 by design and is allowed for.Fixes the new checks found immediately
In
docs/DEVELOPMENT.md, which nothing had ever validated:git clone <repository-url>is not valid shell —<is a redirect — and the directory it thencds into was never the repository name.{lang}.--timeoutillustration is acasefragment, not a script; it istextnow.Also documented the CI and the offline property of the suites there, and added the status badge to the README.